﻿<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>System Sign In</title>
<link rel="stylesheet" href="./css/common.css" type="text/css"
	media="screen" />
<link rel="stylesheet" href="./css/style.css" type="text/css"
	media="screen" />
<script type="text/javascript" src="./js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="./js/common.js"></script>

</head>
<body id="login">
	<div id="login-wrapper" class="png_bg">
		<div id="login-top" style='background:RGB(40,40,40);'>
			<h1>Simpla Admin</h1>
			<!-- Logo (221px width) -->
			<a href="#"> <img id="logo" src="./img/logo.png"
				alt="Simpla Admin logo" /> </a>
		</div>
		<!-- End #logn-top -->
		<div id="login-content" style='padding-top:60px;'>
			<div>
				<p>
					<label> Username </label> <input class="text-input" type="text"
						placeholder="请输入用户名" id='userid' />
				</p>
				<div class="clear"></div>
				<p>
					<label> Password </label> <input class="text-input" type="password"
						placeholder="请输入密码" id='pwd' />
				</p>
				<div class="clear"></div>
				<p id="remember-password">
					<input type="checkbox" /> Remember me
				</p>
				<div class="clear"></div>
				
					<div class="button" style="margin-left:240px;margin-top:10px;"
						onclick='clickLog();' >Sign In</div>
				
			</div>
		</div>
	</div>
	<div id='footer'
		style='background:RGB(40,40,40);height:10px;width:100%;position:absolute;bottom:0;'>

	</div>
</body>
<script>
	function clickLog() {
		var l=$('#userid').val().length>$('#pwd').val().length?$('#userid').val().length:$('#pwd').val().length;
		if (l>10)
			alert('用户名或密码过长!');
		else{
			$.ajax({
				type : "POST",
				url : "/jxc/login.do",
				async:false,
				data:{
					"userid":$('#userid').val(),
					//"account":$('#userid').val(),
					"pwd":$('#pwd').val()
				},
				contentType: "application/x-www-form-urlencoded; charset=UTF-8",
				dataType : 'json',
				success : function(data) {
					//alert(data[0].name);
					if(data[0]!=null){
						location.href='./index.html';
						_locS['user_type']=data[0].type;
						_locS['user_name']=data[0].name;
						_locS['user_id']=data[0].userid;
					}
					else{
						alert("密码错误");
					}
				},
				error : function(data) {
		           alert("error");
		        }
				
		          
			});
		}
	}
</script>
</html>